/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package simuri.similarity;

import java.util.HashMap;
import java.util.TreeSet;
import simuri.utils.Configuration;
import simuri.utils.EntityUriMap;
import simuri.utils.NamedEntity;

/**
 * This interface must be implemented by approach that compute the initial 
 * similarity between uris in the input knowledge base (and graph). The first
 * getMappings assume that the labels of all uris are given in a HashMap that 
 * maps each URI to all possible values of its label. The second assumes that 
 * the user wants to fetch the data live from the endpoint. Mught be more time-
 * demanding
 * @author Anwender
 */
public interface SimilarityFunction {
    
     /** Allows to preload all the labels of uris in the endpoint of interest
     * 
     * @param endpoint Endpoint
     * @param graph Graph to use
     * @param labelProperties Set of all properties that are used as labels. Allows
     * to use all kinds of properties (abstract, rdfs:label, dc:title, etc.)
     * @return 
     */
    HashMap<String, TreeSet<String>> getUriLabels(String endpoint, String graph, TreeSet<String>
           labelProperties);
    
    /** Allows to retrieve the URIs to a set of named entities
     * 
     * @param inputText Text given in by the user 
     * @param entities Set of named entites
     * @param uriLabels Lab
     * @return 
     */
    EntityUriMap getMappings(String inputText, TreeSet<NamedEntity> entities, 
            HashMap<String, TreeSet<String>> uriLabels);
    
    EntityUriMap getMappings(String inputText, TreeSet<NamedEntity> entities, 
            String sparqlEndpoint, String graph, TreeSet<String> labelProperties);
    
    EntityUriMap getMappings(Configuration c, TreeSet<NamedEntity> entities);
    
}
